package sg.edu.nus.iss.billing.service.login;

import java.util.ArrayList;
import java.util.List;

import sg.edu.nus.iss.billing.common.Util;
import sg.edu.nus.iss.billing.common.exception.BadDaoCallException;
import sg.edu.nus.iss.billing.dao.customer.ComplaintsDAO;
import sg.edu.nus.iss.billing.dao.customer.CustomerDAO;
import sg.edu.nus.iss.billing.service.customer.CustomerComplaintServiceImpl;
import sg.edu.nus.iss.billing.service.customer.ICustomerComplaintService;
import sg.edu.nus.iss.billing.vo.customer.CustomerComplaintVO;
import sg.edu.nus.iss.billing.vo.customer.CustomerVO;
import sg.edu.nus.iss.billing.vo.login.LoginVO;


public class CallAgent extends UserImpl{
	
//	public CallAgent(String user, String password) {
//		
//		// TODO Auto-generated constructor stub
//	}
	
	private ICustomerComplaintService customerComplaintService;

	public CallAgent(LoginVO loginVO) {
		super(loginVO);
		// TODO Auto-generated constructor stub
	}


	public void viewBill(){
		
	}
	
	public CustomerVO viewCustomerDetailsByNRIC(String NRIC){
		CustomerDAO cdao = new CustomerDAO();
		CustomerVO cvo = cdao.findCustomerByNric(NRIC);
		return cvo;
	}
	
	public CustomerVO viewCustomerDetailsByAcctNo(String accountNo){
		CustomerDAO cdao = new CustomerDAO();
		CustomerVO cvo = cdao.findCustomerByAcc(accountNo);
		return cvo;
	}
	
	public void logCustomerComplaint(CustomerComplaintVO custComplaintVO) throws BadDaoCallException{
		customerComplaintService = new CustomerComplaintServiceImpl();
		customerComplaintService.createCustomerComplaint(custComplaintVO);
	}
	
	public ArrayList<CustomerComplaintVO>  viewCustomerComplaint(String acctNo){
		
		customerComplaintService = new CustomerComplaintServiceImpl();
		return (ArrayList<CustomerComplaintVO>) customerComplaintService.viewAllCustomerComplaintsByAccId(acctNo);
		
//		return ccList;
		
	}
	
	public void updateCustomerComplaint(String acctNo, String complaintId){
		customerComplaintService = new CustomerComplaintServiceImpl();
		customerComplaintService.updateCustomerComplaint(acctNo, complaintId,"Pending");
	}


}
